package com.project.service.imp;

import com.project.bean.CutPageBean;
import com.project.bean.RoomBean;
import com.project.bean.StudentBean;
import com.project.bean.UserBean;
import com.project.dao.IRoomDao;
import com.project.dao.IStudentDao;
import com.project.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImp implements StudentService {
    @Autowired
    private IStudentDao dao;

    @Override
    public void add(StudentBean studentBean) {
        dao.add(studentBean);
    }

    @Override
    public StudentBean findById(Integer id) {
        return dao.findById(id);
    }

    @Override
    public CutPageBean<StudentBean> findByItem(Integer pageNO, String name, String className, String room) {
        return dao.findByItem(pageNO, name, className, room);
    }

    @Override
    public void delStu(Integer id) {
        dao.delStu(id);
    }

    @Override
    public void updateRoom(Integer id, Integer roomId) {
//        List<RoomBean> list = roomDao.findBySex(stuDao.findById(id).getSex());
        dao.updateRoom(id, roomId);
    }


}
